﻿#region Using Directives

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Resources;
    using System.Threading;
    using System.Web;
    using System.Net.Mail;

    using MarketPulse.BusinessLogic.Common;
    using MarketPulse.Web.Helpers;

#endregion

namespace MarketPulse.Web.UI
{

    /// <summary>
    /// Summary description for Page
    /// </summary>
    public class MasterPage : System.Web.UI.MasterPage
    {
        #region Member Variables

            /// <summary>Local variable used to determine whether a page should check if a user is logged on before continuing</summary>
            protected bool mCheckAuthentication = true;

            /// <summary>Property that stores the name of the class.</summary>
            protected static readonly Type mClass = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;

            /// <summary>Property that stores the log4net logger for this class.</summary>
            protected static readonly log4net.ILog mLog = log4net.LogManager.GetLogger(mClass);

        #endregion

        #region Methods

            #region Handlers

                /// <summary>
                /// Method used to handle the init event for this page
                /// </summary>                
                /// <param name="e">The event arguments passed by the object that raised this event</param>
                protected override void OnInit(EventArgs e)
                {
                    mCheckAuthentication = true;

                    LoadLanguages();

                    base.OnInit(e);
                }     

            #endregion

            #region Local Methods

                /// <summary>
                /// Methods used to load in the available list of languages
                /// </summary>
                private void LoadLanguages()
                {
                    if (SessionManager.AvailableLanguages == null)
                    {
                        SessionManager.AvailableLanguages = LanguageInfoList.GetList();
                    }
                }

            #endregion

        #endregion
    }
}